import {createRouter, createWebHistory,createWebHashHistory } from "vue-router";
// createRouter 创建路由对象的方法
// createWebHistory 创建历史模式路由的方法
// createWebHashHistory 创建的hash模式的方法

let routes=[
  {
    path:"/",
    redirect:"/home",
  },
  {
    path:"/home",
    name:"home",
    component:()=>import("../views/home/index.vue")
},
{
    path:"/about",
    name:"about",
    component:()=>import("../views/about/index.vue"),
    children:[],

},
{
    path:"/category",
    name:"category",
    component:()=>import("../views/category/index.vue"),
    children:[],

},
{
    path:"/todo",
    name:"todo",
    component:()=>import("../views/todolist/index.vue"),
    children:[],

},
{
    path:"/mine",
    name:"mine",
    component:()=>import("../views/mine/index.vue"),
    children:[],

},
{
    path:"/cart",
    name:"cart",
    component:()=>import("../views/cart/index.vue"),
    meta:{
      title:"重要数据"
    }
}]

// 创建路由对象
let router=createRouter({
 history:createWebHistory(), //调整路由模式的配置
 routes:routes //路由配置项
})

export default router